//
//  ViewController.m
//  ShareDemo
//
//  Created by zhangyongbin on 7/14/15.
//  Copyright (c) 2015 Beijing YunJi Technology Company. All rights reserved.
//

#import "ViewController.h"
#import "JBSNSShare.h"

@interface ViewController ()

@end

@implementation ViewController


- (IBAction)sl:(id)sender
{
    UIImage *image = [UIImage imageNamed:@"logo"];
    [JBSNSShare presentSnsIconSheetView:self title:@"JustBen的博客" content:@"欢迎访问JustBen的博客" image:image url:@"http://justben.me" completion:^(NSError *error) {
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:error.description message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
        [alertView show];
    }];
}

- (IBAction)sina:(id)sender
{
    UIImage *image = [UIImage imageNamed:@"default_icon"];
    [JBSNSShare shareWithShareType:JBSNSShareTypeToSinaWeibo Title:@"Sina Title" Content:@"Sina Content" image:image url:@"http://justben.me" presentedController:self completion:^(NSError *error) {
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:error.description message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
        [alertView show];
    }];
}

- (IBAction)qq:(id)sender
{
    UIImage *image = [UIImage imageNamed:@"logo"];
    [JBSNSShare shareWithShareType:JBSNSShareTypeToMobileQQ Title:@"mobile qq Title" Content:@"mobile qq Content" image:image url:@"http://justben.me" presentedController:self completion:^(NSError *error) {
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:error.description message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
        [alertView show];
    }];
}

- (IBAction)qzone:(id)sender
{
    UIImage *image = [UIImage imageNamed:@"logo"];
    [JBSNSShare shareWithShareType:JBSNSShareTypeToQzone Title:@"qzone Title" Content:@"qzone Content" image:image url:@"http://justben.me" presentedController:self completion:^(NSError *error) {
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:error.description message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
        [alertView show];
    }];
}

- (IBAction)ws:(id)sender
{
    UIImage *image = [UIImage imageNamed:@"logo"];
    [JBSNSShare shareWithShareType:JBSNSShareTypeToWechatSession Title:@"w s Title" Content:@"w s Content" image:image url:@"http://justben.me" presentedController:self completion:^(NSError *error) {
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:error.description message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
        [alertView show];
    }];
}

- (IBAction)wt:(id)sender
{
    UIImage *image = [UIImage imageNamed:@"logo"];
    [JBSNSShare shareWithShareType:JBSNSShareTypeToWechatTimeline Title:@"w t Title" Content:@"w t Content" image:image url:@"http://justben.me" presentedController:self completion:^(NSError *error) {
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:error.description message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
        [alertView show];
    }];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
